package ups.glre.news.struts.form;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;

import ups.glre.news.model.Category;
import ups.glre.news.model.News;

public class NewsForm extends ActionForm {
	private static final long serialVersionUID = 1L;
	
	private int newsId;
	private int userId;	
	private String title;
	private String content;
	private int categoryId;
	
	private List<Category> categories = new ArrayList<Category>();	
	private List<News> newsList = new ArrayList<News>();
	
	private String actionType;	
	private String methodToCall;	
	
	public String getMethodToCall() {
		return methodToCall;
	}
	
	public void setMethodToCall(String methodToCall) {
		this.methodToCall = methodToCall;
	}
	
	public int getUserId() {
		return userId;
	}
	
	public void setUserId(int userId) {
		this.userId = userId;
	}
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public int getCategoryId() {
		return categoryId;
	}
	
	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}
	
	public void addNews(News news){
		newsList.add(news);
	}
	
	public void removeNews(News news){
		newsList.remove(news);
	}
	
	public void setNewsList(List<News> newsList) {
		this.newsList = newsList;
	}
	
	public List<News> getNewsList() {
		return newsList;
	}
	
	public void setActionType(String actionType) {
		this.actionType = actionType;
	}
	
	public String getActionType() {
		return actionType;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setCategories(List<Category> categories) {
		this.categories = categories;
	}
	
	public List<Category> getCategories() {
		return categories;
	}
	
	public void setNewsId(int newsId) {
		this.newsId = newsId;
	}
	
	public int getNewsId() {
		return newsId;
	}
}
